AO3-7275 Unreviewed comments marked as spam are still visible to creators#5577
AO3-7275 Unreviewed comments marked as spam are still visible to creators#5577archie-2006 wants to merge 14 commits into
Conversation
Updated comment to include not_spam scope filter unreviewed comments in commentscontroller using not_spam update specs to verify spam comments are excluded from viewing
|
Hi, Archie Singh! Thank you so much for this pull request, someone will be along to review it soon. I've also updated the Jira issue status to In Review so no one will mistakenly create a duplicate pull request. If you'd like the ability to comment on, assign, and transition issues in the future, you're welcome to create a Jira account! It makes things a bit easier for us on the organizational side if the Full Name on your Jira account either closely matches the name you'd like us to credit in the release notes or includes it in parentheses, e.g. "Nickname (CREDIT NAME)." Once you've done that (or if you've already done it -- Jira has been unreliable about showing us new accounts in the admin panel lately), you can either reply here or send an email to otw-coders@transformativeworks.org with your account name and email address and we'll set up the permissions for you. Thanks again for contributing! If you have any questions, you can contact us at the same email address listed above. |
Bilka2
left a comment
There was a problem hiding this comment.
Thanks for getting started on this! Please also adjust app/views/works/_work_header_navigation.html.erb to display the correct comment count for users
|
|
||
| Scenario: Creator marks an unreviewed comment as spam and the count updates | ||
| Given I have a work "Spam Trap" | ||
| And I have "Enable comment moderation" checked on "Spam Trap" |
There was a problem hiding this comment.
Please indent all "And" steps one extra level
|
Hey @Bilka2 I've pushed the fixes for the model scopes, the redundant RSpec test, and formatting+translations as you had asked for (meanwhile let me see if I can fix the rubocop error on my own). |
| else | ||
| @work.find_all_comments.unreviewed_only.not_spam.count | ||
| end %> | ||
| <%= link_to t("works.work_header_navigation.unreviewed_comments", count: unreviewed_count), unreviewed_work_comments_path(@work) %> |
There was a problem hiding this comment.
Could you make this use lazy lookup for the locale, so ".unreviewed_comments"?
| <%# The li, noscript, and button tags MUST be on the same line here to avoid the behavior described in https://otwarchive.atlassian.net/browse/AO3-4629?focusedCommentId=372231 %> | ||
| <%# The li, noscript, and button tags MUST be on the same line here %> |
There was a problem hiding this comment.
Looks like an unrelated change found its way into the file, could you undo it?
|
|
||
| Given "the moderated work {string} by {string}" do |title, login| | ||
| user = ensure_user(login) | ||
| user.preference.update!(allow_co_creator_invite: true) |
There was a problem hiding this comment.
This change is causing the test to fail and seems to be unrelated to this PR, could you remove it?
| And I fill in "Comment" with "Fake spam" | ||
| And I fill in "Name" with "Spammer" | ||
| And I fill in "Email" with "spam@example.com" | ||
| And I press "Comment" |
There was a problem hiding this comment.
Could this be replaced with the I post the comment "..." on "Spam Trap" step?
| When I follow "Unreviewed Comments" | ||
| And I follow "Spam" | ||
| Then I should see "Unreviewed Comments (0)" | ||
| And I should not see "Fake spam" |
There was a problem hiding this comment.
Could you add some steps that check that for admins the count is still 1 and the comment is visible on the page for unreviewed comments but marked as spam?
Additionally, please address the comment about the indentation of the And steps
| Given I am logged in as "spam_catcher" | ||
| And I have a work "Spam Trap" | ||
| And I edit the work "Spam Trap" | ||
| And I check "Enable comment moderation on this work" | ||
| And I press "Post Without Preview" | ||
| And I am logged out |
There was a problem hiding this comment.
Could this be replaced with the the moderated work "Spam Trap" by "spam_catcher" step?
Updated comment to include not_spam scope
filter unreviewed comments in commentscontroller using not_spam update specs to verify spam comments are excluded from viewing
Pull Request Checklist
as the first thing in your pull request title (e.g.
AO3-1234 Fix thing)until they are reviewed and merged before creating new pull requests.
Issue
https://otwarchive.atlassian.net/browse/AO3-7275
Purpose
Unreviewed comments marked as spam remained visible to creators in the unreviewed comments.
added a not_spam scope to filter out spam-flagged comments.
applied the not_spam scope to the index action for unreviewed comments.
while creators have their view filtered, admins retain full visibility of all unreviewed comments for moderation.
modified comment_spec.rb to verify the exclusion of spam from these filtered collections.
References
fixes the issue where unreviewed spam comments behaved differently than reviewed spam comments for creators.
updates the unreviewed comments counter consistently
Credit
Archie Singh (she/her/hers)